<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <h1 id="h1">Hello Word</h1>

  <script>
    async function fn() {
      const res = await (await fetch('http://127.0.0.1:8888/register', {
        method: 'POST',
        headers: {
          'Content-Type': 'application/json'
        },
        body: JSON.stringify({ username: '123456', password: '1122211' })
      })).json()
    }

    h1.onclick = () => fn()
  </script>
</body>

</html>